﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace calendar
{
public sealed class DayType
{
    public static readonly int WORKING = 1;
    public static readonly int NON_WORKING = 0;
    public static readonly int DEFAULT = 2;


    private int m_value;
    private static DayType[] TYPE_VALUES = {
        new DayType(0),
        new DayType(1),
        new DayType(2)
    };

    private DayType(int value)
    {
        m_value = value;
    }

    public static DayType getInstance(int type)
    {
        if (type < 0 || type >= TYPE_VALUES.Length) {
            type = NON_WORKING;
        }
        return (TYPE_VALUES[type]);
    }

    public int getValue()
    {
        return m_value;
    }

}
}
